#ifndef __GLOBAL_HOMOGRAPHY_CALCULATOR_H__
#define __GLOBAL_HOMOGRAPHY_CALCULATOR_H__

#include <vector>
#include <boost/smart_ptr.hpp>

namespace cshotel {
    class InputImage;
    class ImageMatch;
    class ImageSet;
    
    class GlobalHomographyCalculator {
    public:
        GlobalHomographyCalculator(boost::shared_ptr<ImageSet> imgs);
        void calculate();
        
    private:
        boost::shared_ptr<ImageSet> imageSet;
        boost::shared_ptr<InputImage> center;
        
        void findCenter();
        double calculateNextDistance(double currentDistance, boost::shared_ptr<ImageMatch> edge);
        double calculateRootDistance(boost::shared_ptr<InputImage> root);
        double assignHomographiesFrom(boost::shared_ptr<InputImage> root);
    };
}

#endif
